<?php

class login {

  // p1 : frame ; p2 : template
  function beginLoginForm (&$shop,$params) {
    $shop->out('<form action="'.$shop->getVar('SECURE_SCRIPT_NAME').'" target="'.$params[0].'"><input type="hidden" name="a" value="cl"><input type="hidden" name="tr" value="'.$shop->getVar('TEMPLATE_ROOT').'"><input type="hidden" name="t" value="'.$params[1].'">');
  }

  function loginEmailField (&$shop,$params) {
    $shop->out('<input type="text" name="cem" maxlength="30" '.$params[0].'>');
  }

  function loginPasswordField (&$shop,$params) {
    $shop->out('<input type="password" name="cpw" maxlength="20" '.$params[0].'>');
  }

  function loginSubmit (&$shop,$params) {
    $shop->out('<input type="'.$params[0].'" ');
    if ($params[0] == 'image') {
      $shop->out('src="'.$params[1].'" '.$params[2].'>');
    } else {
      $shop->out('value="'.$params[1].'" '.$params[2].'>');
    }
  }

  function endLoginForm (&$shop,$params) {
    $shop->out('</form>');
  }

}

?>